﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Register Src="~/Views/Shared/Textbox.ascx" TagName="textbox" TagPrefix="uc" %>
<%@ Register Src="~/Views/Shared/Button.ascx" TagName="button" TagPrefix="uc" %>

<% 
    int count = 0;
    int currentLightboxID = 0;
    VietImage.Models.Lightbox currentLightbox = null;
    if(ViewData["Lightbox"] != null){
        currentLightbox = (VietImage.Models.Lightbox)ViewData["Lightbox"];
        currentLightboxID = currentLightbox.ID;
    }
    List<VietImage.Models.Lightbox> myLightboxes = (List<VietImage.Models.Lightbox>)ViewData["LightboxList"];
%>
<div id="lightboxmanager" class="dotpanel">
    <div>LIGHTBOXES CỦA BẠN</div>
    <div style="padding: 15px 0px;">
<%
    if (myLightboxes != null)
    {
%>
        <div class="left">Bạn đang xem Lightbox</div>
        <div id="viewinglightbox" class="combobox" value="">
            <div class="combobox_selected"></div>
            <div class="combobox_button"></div>
            <div class="combobox_items">
<%
        foreach (VietImage.Models.Lightbox lb in myLightboxes)
        {
%>
                <div class="combobox_item" value="<%= lb.ID %>" <%= (lb.ID == currentLightboxID)?"selected=''":"" %>><%= lb.Name%></div>
<% 
        }
%>
            </div>
        </div>
        <div class="clear"></div>
        <div class="left">Ngày khởi tạo:</div>
        <div class="left"><%= currentLightbox.CreatedTime.ToString("d / M / yyyy") %></div>
<%    
    }
    else
    {
%>
        <div>Bạn chưa có lightbox nào</div>
<%
    }
%>
        <div class="clear"></div>
    </div>
    <div>
        <div style="line-height: 40px;">CÁC TÙY CHỌN</div>
        <div style="margin-bottom: 40px;">
            <div class="function"><span id="renamelightbox">Đổi tên</span></div>
            <div class="function"><span id="deletelightbox">Xóa</span></div>
            <div class="function"><span id="createlightbox">Tạo Lightbox mới</span></div>
            <div class="function"><span>Tải Lightbox (PDF)</span></div>
            <div class="function"><span>Email Lightbox</span></div>
        </div>
        <div id="lightboxmanager_form">
            <form id="frmlightboxmanager" name="frmlightboxmanager" onsubmit="return lightboxmanagersubmit();" onreset="return lightboxmanagerreset();">
                <div id="lightboxlabel" class="float: left">Tạo Lightbox</div>
                <input id="lightboxmanagertype" name="lightboxmanagermode" type="hidden" value="create" />
                <uc:textbox ID="txtlightboxname" Style="width: 200px;" runat="server" />
                <uc:button ID="btnlightboxsubmit" Type="submit" Value="Tạo" runat="server" />
                <uc:button Type="reset" Value="Hủy" runat="server" />
                <div class="clear"></div>
            </form>
        </div>
    </div>


</div>